package persistencia;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import util.Conexion;
import bean.TPRDE;

public class TPRDEDAO {

	public TPRDE buscarTPRDE(String rccpro) throws SQLException {
		Statement s = null;
		ResultSet rs = null;
		TPRDE nuevo = null;
		Connection cn = Conexion.obtenerConexion();		
		s = cn.createStatement();
		rs = s.executeQuery("Select PRDCVE,PRDRF1 from TPRDE where PRDCVE='" + rccpro+ "' and PRDTAU='PR'" );

		while (rs.next()) {
			nuevo = new TPRDE();
			nuevo.setPrdcve(rs.getString(1));
			nuevo.setPrdrf1(rs.getString(2));
		}

		rs.close();
		s.close();

		return nuevo;
	}

}
